/**
 * @Author: 焦质晔
 * @Date: 2019/6/20
 * @Last Modified by:   焦质晔
 * @Last Modified time: 2019-06-20 15:45:00
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 预入库页面列表数据
export const getPreWhList = params => axios.get(`${SERVER.VEHICLE}/purchase/salPreWh/search`, { params });

// 获取采购入出库列表数据
export const getSalPurchaseList = params => axios.get(`${SERVER.VEHICLE}/purchase/salPurchase/search`, { params });

// 获取仓库信息
export const getStoreList = params => axios.get(`${SERVER.VEHICLE}/store/search`, { params });

// 获取供应商
export const getBusinessCustomerList = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/businessCustomer`, { params });

// 获取产品代码产品名称信息
// export const getProdCodeByCode = params => axios.get(`${SERVER.BASEDATA}/vsProduct/getProductByCode`, { params });
// 获取产品代码产品名称信息
export const getProdCodeByCode = params => axios.get(`${SERVER.VEHICLE}/purchase/salPurchase/getProductByCode`, { params });

// 保存入库
export const saveSalPurchase = params => axios.post(`${SERVER.VEHICLE}/purchase/salPurchase/save`, params);

// 执行入库
export const exeSaveSalPurchase = params => axios.post(`${SERVER.VEHICLE}/purchase/salPurchase/exeSave`, params);

// 根据purchaseId查询详细记录
export const searchDetailsByPurchaseId = params => axios.get(`${SERVER.VEHICLE}/purchase/salPurchase/searchDetailsByPurchaseId`, { params });

// 查询已执行采购入库的车辆信息
export const getVinList = params => axios.get(`${SERVER.VEHICLE}/purchase/salPurchase/getVinList`, { params });

// 删除记录
export const doRemove = params => axios.get(`${SERVER.VEHICLE}/purchase/salPurchase/deleteById`, { params });

// 根据purchaseId查询可以退库的车辆
export const searchVinListByPurchaseId = params => axios.get(`${SERVER.VEHICLE}/purchase/salPurchase/searchVinListByPurchaseId`, { params });

// 采购退库选择车辆
export const getReturnVinList = params => axios.get(`${SERVER.VEHICLE}/purchase/salPurchase/getReturnVinList`, { params });

// 获取登录人portal账号
export const getportal = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/portal/getPortal`, { params });
